package com.colorful.exceldemo.controller;

import com.colorful.exceldemo.excel.BuildingExport;
import com.colorful.exceldemo.toolkit.EasyExcelUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;

/**
 * @author kang junjie
 * @date 2022/6/9 16:20
 */
@RestController
@Api
public class ExcelController {


    /**
     * 导出级联模板
     */
    @GetMapping("/import/building/template")
    @ResponseBody
    @ApiOperation(value = "导入建筑模板")
    public String buildingTemplate(HttpServletResponse response) {
        EasyExcelUtil.export(response,"template","建筑信息", BuildingExport.class, null);
        return "ojbk";
    }
}
